package com.objcat.servicea.entity.po;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.time.LocalDate;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.objcat.servicea.entity.dto.UserDto;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 
 * </p>
 *
 * @author misheep
 * @since 2020-07-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_user")
public class UserPo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户id
     */
    @TableId(value = "user_id", type = IdType.AUTO)
    private Long userId;

    /**
     * 用户name
     */
    private String userName;

    /**
     * 密码
     */
    private String userPassword;

    /**
     * 创建时间
     */
    private LocalDate createTime;

    /**
     * 转换为Dto
     * @return
     */
    public UserDto getUserDto(){
        UserDto userDto = new UserDto();
        userDto.setUserId(this.userId);
        userDto.setUserName(this.userName);
        userDto.setUserPassword(this.getUserPassword());
        return userDto;
    }
}
